#ifndef RECORD_COMMAND_IN_H_
#define RECORD_COMMAND_IN_H_
#include "command.h"

#pragma pack(1)
namespace Cmd
{
        namespace Record
        {
                //  cmd declaration
                enum {
                        CMDIN_LOGIN             = 0x0010,	// 登录RecordServer验证指令
                        CMDIN_FORWARD           = 0x0011,	// 转发的指令
                        CMDIN_SESSION           = 0x0012,	// 与SessionServer交互的指令
                        CMDIN_ROOM              = 0x0013,	// 与RoomServer交互的指令
                };
                enum { //CMDIN_LOGIN
                        SCMDIN_LOGIN                            = 0x0001,	// 请求登录RecordServer
                        SCMDIN_LOGIN_RESPONCE                   = 0x0002,	// 登录RecordServer返回
                };
                enum { //CMDIN_FORWARD
                        SCMDIN_FORWARD_RECORD                   = 0x0001,       // 转发到RecordServer的指令
                        SCMDIN_FORWARD_USER                     = 0x0002,	// RecordServer转发指令给用户
                };
                enum { //CMDIN_SESSION
                        SCMDIN_SESSION_NOTIFY_LOGIN             = 0x0006,       // session->record:通知用户登录-用于记录日志
                        SCMDIN_SESSION_NOTIFY_LOGOUT            = 0x0007,       // session->record:通知用户下线-用于记录日志
                        SCMDIN_SESSION_ADD_BUDDY                = 0x0008,	// Session->Record:请求增加好友
                        SCMDIN_SESSION_RETURN_ADD_BUDDY         = 0x0009,	// Record->Session:返回增加好友的结果
                        SCMDIN_SESSION_DEL_BUDDY                = 0x000A,	// Session->Record:请求删除好友
                        SCMDIN_SESSION_RETURN_DEL_BUDDY         = 0x000B,	// Record->Session:返回删除好友的结果
                        SCMDIN_SESSION_UPDATE_BUDDY_INFO        = 0x000C,	// Session->Record:请求更新好友的分组和备注
                        SCMDIN_SESSION_RETURN_UPDATE_BUDDY_INFO = 0x000D,	// Record->Session:返回更新好友信息的结果
                        SCMDIN_SESSION_REQ_BUDDY_INFO           = 0x000E,
                        SCMDIN_SESSION_RES_BUDDY_INFO           = 0x000F,
                        SCMDIN_SESSION_REQ_UPDATE_BUDDY_REMARK  = 0x0010,
                        SCMDIN_SESSION_RES_UPDATE_BUDDY_REMARK  = 0x0011,
                        SCMDIN_SESSION_UPDATE_NICKNAME          = 0x0012,
                        SCMDIN_SESSION_UPDATE_MOOD              = 0x0013,
                        SCMDIN_SESSION_ACCEPT_STRANGER_MSG      = 0x0014,	// Session->Record:设置是否接收陌生人消息
                        SCMDIN_SESSION_REQ_ALL_ROOM_LIST        = 0x0015,       // s->r: 请求所有房间的列表信息 (临时)
                        SCMDIN_SESSION_RES_ALL_ROOM_LIST        = 0x0016,       // r->s: 返回所有房间的列表信息 (临时)
                        SCMDIN_SESSION_HISTORY_CONTACT_LIST_SAVE        = 0x0017,       // s->r: 保存最近联系人列表
                        SCMDIN_SESSION_HISTORY_CONTACT_LIST_REQ = 0x0018,       // s->r: 请求最近联系人列表
                        SCMDIN_SESSION_HISTORY_CONTACT_LIST_RES = 0x0019,       // r->s: 返回最近联系人列表
                        SCMDIN_SESSION_HISTORY_ROOM_SAVE        = 0x001A,       // s->r: 保存历史房间
                        SCMDIN_SESSION_HISTORY_ROOM_REQ_old     = 0x001B,       // s->r: 请求历史房间列表
                        SCMDIN_SESSION_HISTORY_ROOM_RES_old     = 0x001C,       // r->s: 返回历史房间列表
                        SCMDIN_SESSION_NOTIFY_SYS_ADD_FRIEND    = 0x001D,       // r->s: 通知SessionServer系统添加好友
                        SCMDIN_SESSION_CHECK_CLIENT_VERSION     = 0x001E,       // s->r: 检测客户端最新版本
                        SCMDIN_SESSION_REQ_NOTIFY_ROOM_SIMPLE_INFO      = 0x001F,       //s->r: 请求通知用户某个房间的简单信息
                        SCMDIN_SESSION_NOTIFY_BLACK_ID          = 0x0020,       // r->s:
                        SCMDIN_SESSION_NOTIFY_BLACK_IP          = 0x0021,       // r->s:
                        SCMDIN_SESSION_BUDDY_GROUP_LIST_REQ     = 0x0022,
                        SCMDIN_SESSION_BUDDY_GROUP_LIST_RES     = 0x0023,
                        SCMDIN_SESSION_BUDDY_GROUP_CREATE_REQ   = 0x0024,
                        SCMDIN_SESSION_BUDDY_GROUP_DEL_REQ      = 0x0025,
                        SCMDIN_SESSION_BUDDY_GROUP_ADD_USER     = 0x0026,
                        SCMDIN_SESSION_BUDDY_GROUP_RENAME_REQ   = 0x0027,
                        SCMDIN_SESSION_BUDDY_GROUP_UPDATE_ORDER_REQ     = 0x0028,
                        SCMDIN_SESSION_UPDATE_BUDDY_GROUP_RES   = 0x0029,
                        SCMDIN_SESSION_COLLECT_ROOM_LIST_REQ    = 0x002A,
                        SCMDIN_SESSION_COLLECT_ROOM_LIST_RES    = 0x002B,
                        SCMDIN_SESSION_UPDATE_COLLECT_ROOM      = 0x002C,
                        SCMDIN_SESSION_MIS_INFO_RES             = 0x002D,       // MIS返回
                        SCMDIN_SESSION_BUDDY_GROUP_CREATE_RES   = 0x002E,
                        SCMDIN_SESSION_BUDDY_GROUP_DEL_RES      = 0x002F,
                        SCMDIN_SESSION_BUDDY_GROUP_RENAME_RES   = 0x0030,
                        SCMDIN_SESSION_BUDDY_GROUP_UPDATE_ORDER_RES     = 0x0031,
                        SCMDIN_SESSION_MIS_INFO_REQ             = 0x0032,       // MIS请求
                        SCMDIN_SESSION_LOGIN_USER_REQ           = 0x0033,       // s->r: session请求为登录用户加载信息
                        SCMDIN_SESSION_LOGIN_USER_RES           = 0x0034,       // r->s: record返回登录用户的基本信息
                        SCMDIN_SESSION_BUDDY_LIST_REQ           = 0x0035,       // s->r: session请求用户的好友列表
                        SCMDIN_SESSION_BUDDY_LIST_RES           = 0x0036,       // r->s: record返回用户的好友列表
                        SCMDIN_SESSION_SYNC_CLIENT_REPORT_PARAMETER     = 0x0037,
                        SCMDIN_SESSION_FILTER_WORDS_REQ         = 0x0038,
                        SCMDIN_SESSION_FILTER_WORDS_RES         = 0x0039,
                        SCMDIN_SESSION_HISTORY_ROOM_REQ         = 0x003A,       // s->r: 请求历史房间列表
                        SCMDIN_SESSION_HISTORY_ROOM_RES         = 0x003B,       // r->s: 返回历史房间列表
                        SCMDIN_SESSION_TASK_LIST_REQ            = 0x003C,       // s->r: 请求任务列表
                        SCMDIN_SESSION_TASK_LIST_RES            = 0x003D,       // r->s: 返回任务列表
                        SCMDIN_SESSION_USER_TASK_LIST_REQ       = 0x003E,       // s->r: 请求用户的任务列表
                        SCMDIN_SESSION_USER_TASK_LIST_RES       = 0x003F,       // r->s: 返回用户的任务列表
                        SCMDIN_SESSION_USER_TASK_STAT_CHANGE    = 0x0040,       // s->r: session通知record用户的任务状态修改
                        SCMDIN_SESSION_TASK_CLEAR_OLD           = 0x0041,       // s->r: session通知record清空昨天的用户任务状态
                        SCMDIN_SESSION_USER_TASK_LAST_REWARD    = 0x0042,       // s->r: 通知保存上次获取的奖励
                        SCMDIN_SESSION_USER_TASK_LAST_REWARD_RES= 0x0043,       // r->s: 通知session用户上次获取的奖励
                        SCMDIN_SESSION_PASS_USER_USERSTATUS_CHANGE      = 0x0044,       // r->s: 通知Session用户的状态改变
                        SCMDIN_SESSION_PASS_USER_NICKNAME_CHANGE        = 0x0045,       // r->s: 通知Session用户的昵称改变
                        SCMDIN_SESSION_USER_NICKNAME_CHANGE_REQ = 0x0046,       // s->r: 请求修改用户昵称
                        SCMDIN_SESSION_USER_NICKNAME_CHANGE_RET = 0x0047,       // r->s: 返回修改用户昵称结果
                        SCMDIN_SESSION_ARS_CONFIGURATION_REQ    = 0x0048,       // s->r: 请求自动寻路系统参数
                        SCMDIN_SESSION_ARS_CONFIGURATION_RET    = 0x0049,       // r->s: 返回自动寻路系统参数
                        SCMDIN_SESSION_UPDATE_USER_OPTION       = 0x004A,
                };
                enum { //CMDIN_ROOM
                        SCMDIN_ROOM_GET_ROOM_INFO               = 0x0001,	// Room->Record:请求房间基本信息
                };


                //	cmd definition
                struct stLoginCmd:t_NullCmd
                {
                        stLoginCmd():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                dest_type_ = RECORDSERVER;
                                server_type_ = 0;
                                server_id_ = 0;
                        }
                        WORD dest_type_;
                        WORD server_type_;
                        DWORD server_id_;
                };
                struct stLoginResponce:t_NullCmd
                {
                        stLoginResponce():
                                t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                struct stForwardRecord:t_NullCmd
                {
                        stForwardRecord():
                                t_NullCmd(CMDIN_FORWARD, SCMDIN_FORWARD_RECORD)
                        {
                                user_id_ = 0;
                                size_ = 0;
                        }
                        DWORD user_id_;
                        WORD size_;
                        BYTE data_[0];
                        DWORD getSize() const
                        {
                                return sizeof(*this)+size_*sizeof(data_[0]);
                        }
                };
                struct stForwardUser:t_NullCmd
                {
                        stForwardUser():
                                t_NullCmd(CMDIN_FORWARD, SCMDIN_FORWARD_USER)
                        {
                                user_id_ = 0;
                                size_ = 0;
                        }
                        DWORD user_id_;
                        WORD size_;
                        BYTE data_[0];
                        DWORD getSize() 
                        {
                                return sizeof(*this)+size_*sizeof(data_[0]);
                        }
                };
                struct stSessionNotifyLogin:
                        t_NullCmd
                {
                        stSessionNotifyLogin():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_NOTIFY_LOGIN)
                        {
                                user_id_ = 0;
                                time_ = 0;
                                ip_ = 0;
                        }
                        DWORD user_id_;
                        DWORD time_;            //上线时间
                        DWORD ip_;
                        DWORD dev_type_;  // 设备类型
                        DWORD os_type_;   // OS类型
                        char dev_id_[DEVICE_ID_LENGTH];  // 设备ID
                        char unique_id_[128];
                };
                struct stSessionNotifyLogout:
                        t_NullCmd
                {
                        stSessionNotifyLogout():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_NOTIFY_LOGOUT)
                        {
                                user_id_ = 0;
                                time_ = 0;
                                this_online_time_ = 0;
                        }
                        DWORD user_id_;
                        DWORD time_;            //下线时间
                        DWORD this_online_time_;//本次登录时长
                        DWORD reason_;  // 下线原因
                        DWORD dev_type_;  // 设备类型
                        DWORD os_type_;   // OS类型
                        char dev_id_[DEVICE_ID_LENGTH];  // 设备ID                       
                        char unique_id_[128];
                };
                struct stSessionAddBuddy:
                        t_NullCmd
                {
                        stSessionAddBuddy():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_ADD_BUDDY)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                notifyclient = 1;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE notifyclient;      //0-not notify client; 1-notify client; 2-not notify session
                };
                struct stSessionReturnAddBuddy:
                        t_NullCmd
                {
                        stSessionReturnAddBuddy():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RETURN_ADD_BUDDY)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                bzero(buddy_account_, sizeof(buddy_account_));
                                bzero(buddy_nickname_, sizeof(buddy_nickname_));
                                bzero(buddy_mood_, sizeof(buddy_mood_));
                                notifyclient = 1;
                                ret_code_= 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        char buddy_account_[MAX_ACCOUNT_SIZE+1];
                        char buddy_nickname_[MAX_NAME_SIZE+1];
                        char buddy_mood_[MAX_MOOD_SIZE+1];
                        BYTE notifyclient;      //0-no, 1-yes
                        BYTE ret_code_;         //0-fail , 1-success
                };
                struct stSessionDelBuddy:
                        t_NullCmd
                {
                        stSessionDelBuddy():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_DEL_BUDDY)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                notify_client_ = 1;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE notify_client_;    //0-no, 1-yes
                };
                struct stSessionReturnDelBuddy:
                        t_NullCmd
                {
                        stSessionReturnDelBuddy():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RETURN_DEL_BUDDY)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                ret_code_= 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE ret_code_; //0-fail , 1-success
                };
                struct stSessionUpdateBuddyInfo:
                        t_NullCmd
                {
                        stSessionUpdateBuddyInfo():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_BUDDY_INFO)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                buddy_group_ = 0;
                                bzero(buddy_remark_, sizeof(buddy_remark_));
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE buddy_group_;
                        BYTE buddy_remark_[MAX_REMARK_SIZE];
                };
                struct stSessionReturnUpdateBuddyInfo:
                        t_NullCmd
                {
                        stSessionReturnUpdateBuddyInfo():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RETURN_UPDATE_BUDDY_INFO)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                buddy_group_ = 0;
                                bzero(buddy_remark_, sizeof(buddy_remark_));
                                ret_code_ = 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE buddy_group_;
                        BYTE buddy_remark_[MAX_REMARK_SIZE];
                        BYTE ret_code_; //0-fail, 1-success
                };
                struct stSessionReqBuddyInfo:
                        t_NullCmd
                {
                        stSessionReqBuddyInfo():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_REQ_BUDDY_INFO)
                        {
                                user_id_ = 0;
                                buddy_id_= 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                };
                struct stSessionResBuddyInfo:
                        t_NullCmd
                {
                        stSessionResBuddyInfo():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RES_BUDDY_INFO)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                bzero(nick_name_, sizeof(nick_name_));
                                bzero(account_, sizeof(account_));
                                bzero(mood_, sizeof(mood_));
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE nick_name_[MAX_NAME_SIZE+1];
                        BYTE account_[MAX_ACCOUNT_SIZE+1];
                        BYTE mood_[MAX_MOOD_SIZE+1];
                };

                struct stSessionReqUpdateBuddyRemark:
                        t_NullCmd
                {
                        stSessionReqUpdateBuddyRemark():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_REQ_UPDATE_BUDDY_REMARK)
                        {
                                user_id_ = 0;
                                buddy_id_ =0;
                                bzero(remark_, sizeof(remark_));
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        char remark_[MAX_REMARK_SIZE+1];
                };
                struct stSessionResUpdateBuddyRemark:
                        t_NullCmd
                {
                        stSessionResUpdateBuddyRemark():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RES_UPDATE_BUDDY_REMARK)
                        {
                                user_id_ = 0;
                                buddy_id_ =0;
                                bzero(remark_, sizeof(remark_));
                                ret_code_ = 0;
                        }
                        DWORD user_id_;
                        DWORD buddy_id_;
                        char remark_[MAX_REMARK_SIZE+1];
                        BYTE ret_code_; //0-fail, 1-ok
                };
                struct stSessionUpdateNickName:
                        t_NullCmd
                {
                        stSessionUpdateNickName():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_NICKNAME)
                        {
                                user_id_ = 0;
                                bzero(nick_name_, sizeof(nick_name_));
                        }
                        DWORD user_id_;
                        char nick_name_[MAX_NAME_SIZE+1];
                };
                struct stSessionUpdateMood:
                        t_NullCmd
                {
                        stSessionUpdateMood():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_MOOD)
                        {
                                user_id_ = 0;
                                bzero(mood_, sizeof(mood_));
                        }
                        DWORD user_id_;
                        char mood_[MAX_MOOD_SIZE+1];
                };
                struct stSessionAcceptStrangerMsg:
                        t_NullCmd
                {
                        stSessionAcceptStrangerMsg():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_ACCEPT_STRANGER_MSG)
                        {
                                user_id_ = 0;
                                accept_ = 0;
                        }
                        DWORD user_id_;
                        BYTE accept_; //0-not accept; 1-accept
                };
                struct stSessionReqAllRoomInfoList:
                        t_NullCmd
                {
                        stSessionReqAllRoomInfoList():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_REQ_ALL_ROOM_LIST)
                        {
                                user_id_ = 0;
                        }
                        DWORD user_id_;
                };
                struct stSessionResAllRoomInfoList:
                        t_NullCmd
                {
                        stSessionResAllRoomInfoList():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_RES_ALL_ROOM_LIST)
                        {
                                user_id_ = 0;
                                finish_ = 0;
                                num_ = 0;
                        }
                        DWORD user_id_;
                        BYTE finish_; //0-not finish, 1-finish
                        WORD num_;
                        struct {
                                DWORD roomid;
                                BYTE roomtype;
                                char roomname[MAX_ROOM_NAME_SIZE+1];
                                char avatarurl[MAX_AVATAR_SIZE+1];
                                char desc[MAX_ROOM_DESC_SIZE+1];
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stHistoryConatctListSave:
                        t_NullCmd
                {
                        stHistoryConatctListSave():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_CONTACT_LIST_SAVE)
                        {
                                user_id_ = 0;
                                num_ = 0;
                        }
                        DWORD user_id_;
                        WORD num_;
                        struct {
                                DWORD userid;
                                DWORD time;
                                BYTE update; //0-update, 1-insert, 2-delete
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stHistoryConatctListReq:
                        t_NullCmd
                {
                        stHistoryConatctListReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_CONTACT_LIST_REQ)
                        {
                                user_id_ = 0;
                        }
                        DWORD user_id_;
                };
                struct stHistoryConatctListRes:
                        t_NullCmd
                {
                        stHistoryConatctListRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_CONTACT_LIST_RES)
                        {
                                user_id_ = 0;
                                finish_ = 0;
                                num_ = 0;
                        }
                        DWORD user_id_;
                        BYTE finish_; //0-not finish, 1-finish
                        WORD num_;
                        struct {
                                DWORD userid;
                                DWORD time;
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+num_*sizeof(list_[0]);
                        }
                };
                struct stHistoryRoomListSave:
                        t_NullCmd
                {
                        stHistoryRoomListSave():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_ROOM_SAVE)
                        {
                                user_id_ = 0;
                                room_num_ = 0;
                        }
                        DWORD user_id_;
                        WORD room_num_;
                        struct {
                                DWORD room_id_;
                                DWORD time_;
                        } list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+room_num_*sizeof(list_[0]);
                        }
                };
                struct stHistoryRoomListReq_old:
                        t_NullCmd
                {
                        stHistoryRoomListReq_old():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_ROOM_REQ_old)
                        {
                                user_id_ = 0;
                        }
                        DWORD user_id_;
                };
                struct stHistoryRoomListRes_old:
                        t_NullCmd
                {
                        stHistoryRoomListRes_old():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_ROOM_RES_old)
                        {
                                user_id_ = 0;
                                start_ = 0;
                                finish_ = 0;
                                room_num_ = 0;
                        }
                        DWORD user_id_;
                        BYTE start_;    //0-no 1-yes
                        BYTE finish_;   //0-no 1-yes
                        WORD  room_num_;
                        DWORD room_list_[0];
                        DWORD getSize() {
                                return sizeof(*this)+room_num_*sizeof(room_list_[0]);
                        }
                };
                struct stNotifySysAddFriend:
                        t_NullCmd
                {
                        stNotifySysAddFriend():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_NOTIFY_SYS_ADD_FRIEND)
                        {
                                user_id_ = 0;
                                friend_id_ = 0;
                                bzero(friend_account_, sizeof(friend_account_));
                                bzero(friend_nickname_, sizeof(friend_nickname_));
                        }
                        DWORD user_id_;
                        DWORD friend_id_;
                        char friend_account_[MAX_ACCOUNT_SIZE+1];
                        char friend_nickname_[MAX_NAME_SIZE+1];
                };
                struct stSessionCheckClientVersion:
                        t_NullCmd
                {
                        stSessionCheckClientVersion():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_CHECK_CLIENT_VERSION)
                        {
                                user_id_ = 0;
                                version_type_ = 0;
                                version_id_ = 0;
                        }
                        DWORD user_id_;
                        DWORD version_type_;
                        DWORD version_id_;
                };
                struct stSessionReqNotifyRoomSimpleInfo:
                        t_NullCmd
                {
                        stSessionReqNotifyRoomSimpleInfo():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_REQ_NOTIFY_ROOM_SIMPLE_INFO)
                        {
                                user_id_ = 0;
                                room_id_ = 0;
                        }
                        DWORD user_id_;
                        DWORD room_id_;
                };
                struct stNotifyBlackID:
                        t_NullCmd
                {
                        stNotifyBlackID():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_NOTIFY_BLACK_ID)
                        {
                                user_id_ = 0;
                                release_time_ = 0;
                                bzero(reason_, sizeof(reason_));
                        }
                        DWORD user_id_;
                        DWORD release_time_;
                        char reason_[256];
                };
                struct stNotifyBlackIP:
                        t_NullCmd
                {
                        stNotifyBlackIP():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_NOTIFY_BLACK_IP)
                        {
                                ip_ = 0;
                                release_time_ = 0;
                                bzero(reason_, sizeof(reason_));
                        }
                        DWORD ip_;
                        DWORD release_time_;
                        char reason_[256];
                };
                struct stSessionBuddyGroupListReq:
                        t_NullCmd
                {
                        stSessionBuddyGroupListReq()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_LIST_REQ)
                        {
                                user_id_ = 0;
                        }
                        void setUserID(const DWORD &uid)
                        {
                                user_id_ = uid;
                        }
                        DWORD getUserID() const
                        {
                                return user_id_;
                        }
                        DWORD user_id_;
                };
                struct stSessionBuddyGroupListRes:
                        t_NullCmd
                {
                        stSessionBuddyGroupListRes()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_LIST_RES)
                        {
                                user_id_ = 0;
                                num_ = 0;
                        }
                        DWORD GetSize() const 
                        {
                                return sizeof(*this) + num_*sizeof(list_[0]);
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void IncNum()                           { num_++; }
                        DWORD GetUserID()       const           { return user_id_; }
                        WORD GetNum()           const           { return num_; }
                        void AddElement(const BYTE &gid, const BYTE &type, const BYTE &order, const char *name)
                        {
                                list_[num_].SetID(gid);
                                list_[num_].SetType(type);
                                list_[num_].SetOrder(order);
                                list_[num_].SetName(name);
                                IncNum();
                        }


                        DWORD user_id_;
                        WORD num_;
                        struct stGroupInfo {
                                void SetID(const BYTE &gid)  { groupid = gid; };
                                void SetType(const BYTE &gtype) { grouptype = gtype; }
                                void SetOrder(const BYTE &order) { grouporder = order; }
                                void SetName(const char *name) { strncpy(groupname, name, MAX_NAME_SIZE); }
                                BYTE GetID()    const { return groupid; }
                                BYTE GetType()  const { return grouptype; }
                                BYTE GetOrder() const { return grouporder; }
                                const char *GetName() const { return groupname; }

                                BYTE groupid;
                                BYTE grouptype;
                                BYTE grouporder;
                                char groupname[MAX_NAME_SIZE+1];
                        } list_[0];
                };
                struct stSessionBuddyGroupCreateReq:
                        t_NullCmd
                {
                        public:
                                stSessionBuddyGroupCreateReq() 
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_CREATE_REQ)
                                {
                                        user_id_ = 0;
                                        bzero(group_name_, sizeof(group_name_));
                                }
                                void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                                DWORD GetUserID() const                 { return user_id_; }
                                void SetGroupName(const char *name)     { strncpy(group_name_, name, MAX_NAME_SIZE); }
                                const char *GetGroupName() const        { return group_name_; }
                        private:
                                DWORD user_id_;
                                char group_name_[MAX_NAME_SIZE+1];
                };
                struct stSessionBuddyGroupDelReq:
                        t_NullCmd
                {
                        DWORD user_id_;
                        BYTE group_id_;

                        stSessionBuddyGroupDelReq()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_DEL_REQ)

                        {
                                user_id_ = 0;
                                group_id_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetGroupID(const BYTE &groupid)    { group_id_ = groupid; }
                        DWORD GetUserID()       const { return user_id_; }
                        BYTE  GetGroupID()      const { return group_id_; }
                };
                struct stSessionBuddyGroupAddUser:
                        t_NullCmd
                {
                        DWORD user_id_;
                        WORD  num_;
                        BYTE  group_id_;
                        DWORD user_list_[0];

                        stSessionBuddyGroupAddUser():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_ADD_USER)
                        {
                                user_id_ = 0;
                                num_ = 0;
                                group_id_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetNum(const WORD &num)            { num_ = num; }
                        void IncNum()                           { num_++; }
                        void SetGroupID(const BYTE &gid)        { group_id_ = gid; }
                        DWORD GetUserID()       const { return user_id_; }
                        WORD  GetNum()          const { return num_; }
                        BYTE  GetGroupID()      const { return group_id_; }
                        DWORD GetSize()         const { return sizeof(*this) + num_*sizeof(user_list_[0]); }
                };
                struct stSessionBuddyGroupRenameReq:
                        t_NullCmd
                {
                        DWORD user_id_;
                        BYTE  group_id_;
                        char  group_name_[MAX_NAME_SIZE+1];

                        stSessionBuddyGroupRenameReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_RENAME_REQ)
                        {
                                user_id_ = 0;
                                group_id_ = 0;
                                bzero(group_name_, sizeof(group_name_));
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetGroupID(const BYTE &groupid)    { group_id_ = groupid; }
                        void SetGroupName(const char *name)     { strncpy(group_name_, name, MAX_NAME_SIZE); }
                        DWORD GetUserID()       const { return user_id_; }
                        BYTE  GetGroupID()      const { return group_id_; }
                        const char *GetGroupName() const { return group_name_; }
                };
                struct stSessionBuddyGroupUpdateOrderReq:
                        t_NullCmd
                {
                        DWORD user_id_;
                        WORD  num_;
                        struct {
                                BYTE groupid;
                                BYTE grouporder;

                                void SetGroupID(const BYTE &gid) { groupid = gid; }
                                void SetGroupOrder(const BYTE &order) { grouporder = order; }
                                BYTE GetGroupID()       const { return groupid; }
                                BYTE GetGroupOrder()    const { return grouporder; }
                        } list_[0];

                        stSessionBuddyGroupUpdateOrderReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_UPDATE_ORDER_REQ)
                        {
                                user_id_ = 0;
                                num_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetNum(const WORD &num)            { num_ = num; }
                        void IncNum()                           { num_++; }
                        DWORD GetUserID()       const { return user_id_; }
                        WORD  GetNum()          const { return num_; }
                        DWORD GetSize()         const { return sizeof(*this) + num_*sizeof(list_[0]); }
                };
                struct stSessionUpdateBuddyGroupRes:
                        t_NullCmd
                {
                        stSessionUpdateBuddyGroupRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_BUDDY_GROUP_RES)
                        {
                                user_id_ = 0;
                                buddy_id_ = 0;
                                group_id_ = 0;
                        }
                        void setUserID(const DWORD &uid)        { user_id_ = uid; }
                        void setBuddyID(const DWORD &bid)       { buddy_id_ = bid; }
                        void setGroupID(const BYTE &gid)        { group_id_= gid; }
                        DWORD getUserID()       const { return user_id_; }
                        DWORD getBuddyID()      const { return buddy_id_; }
                        BYTE getGroupID()       const { return group_id_; }

                        DWORD user_id_;
                        DWORD buddy_id_;
                        BYTE  group_id_;
                };
                struct stSessionCollectRoomListReq:
                        t_NullCmd
                {
                        public:
                                stSessionCollectRoomListReq()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_COLLECT_ROOM_LIST_REQ)
                                {
                                        user_id_ = 0;
                                }
                                void setUserID(const DWORD &uid)
                                {
                                        user_id_ = uid;
                                }
                                DWORD getUserID(void) const
                                {
                                        return user_id_;
                                }
                        private:
                                DWORD user_id_;
                };
                struct stSessionCollectRoomListRes:
                        t_NullCmd
                {
                        public:
                                stSessionCollectRoomListRes()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_COLLECT_ROOM_LIST_RES)
                                {
                                        user_id_ = 0;
                                        num_ = 0;
                                }
                                DWORD getSize()
                                {
                                        return sizeof(*this)+num_*sizeof(list_[0]);
                                }
                                void setUserID(const DWORD &uid)
                                {
                                        user_id_ = uid;
                                }
                                DWORD getUserID() const
                                { 
                                        return user_id_;
                                }
                                void setNum(const WORD &num)
                                {
                                        num_ = num;
                                }
                                WORD getNum(void) const
                                {
                                        return num_;
                                }
                                void addElement(const DWORD &roomid)
                                {
                                        list_[num_] = roomid;
                                        num_++;
                                }
                                DWORD getElement(const WORD &n)
                                {
                                        return list_[n];
                                }

                        private:
                                DWORD user_id_;
                                WORD num_;
                                DWORD list_[0];
                };
                struct stUpdateCollectRoom:
                        t_NullCmd
                {
                        public:
                                stUpdateCollectRoom()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_COLLECT_ROOM)
                                {
                                        user_id_ = 0;
                                        room_id_ = 0;
                                        type_ = 0;
                                }
                                void setUserID(const DWORD &uid)
                                {
                                        user_id_ = uid;
                                }
                                DWORD getUserID() const
                                { 
                                        return user_id_;
                                }
                                void setRoomID(const DWORD &rid)
                                {
                                        room_id_ = rid;
                                }
                                DWORD getRoomID(void) const
                                {
                                        return room_id_;
                                }
                                void setType(const BYTE &type)
                                {
                                        type_ = type;
                                }
                                BYTE getType(void) const
                                {
                                        return type_;
                                }
                        private:
                                DWORD user_id_;
                                DWORD room_id_;
                                BYTE  type_; //0-add, 1-del
                };

                struct stMisInfoRes:
                        t_NullCmd
                {
                        public:
                                stMisInfoRes()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_MIS_INFO_RES)
                                {
                                }
                                DWORD getSize()
                                {
                                        return sizeof(*this)+num_*sizeof(list_[0]);
                                }
                                void setNum(const WORD &n)
                                {
                                        num_ = n;
                                }
                                WORD getNum(void) const
                                {
                                        return num_;
                                }
                                DWORD getElement(const WORD &n)
                                {
                                        return list_[n];
                                }
                                void addElement(const DWORD &uid)
                                {
                                        list_[num_++] = uid;
                                }
                        private:
                                WORD num_;
                                DWORD list_[0];
                };

                struct stSessionBuddyGroupCreateRes:
                        t_NullCmd
                {
                        public:
                                stSessionBuddyGroupCreateRes() 
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_CREATE_RES)
                                {
                                        user_id_        = 0;
                                        bzero(group_name_, sizeof(group_name_));
                                        group_id_       = 0;
                                        type_           = eFriendGroupType_custom;
                                        order_          = 0;
                                        ret_code_       = 0;
                                }
                                void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                                void SetGroupName(const char *name)     { strncpy(group_name_, name, MAX_NAME_SIZE); }
                                void SetOrder(const BYTE &order)        { order_ = order; }
                                void SetGroupID(const DWORD &gid)       { group_id_ = gid; }
                                void SetType(const BYTE &type)          { type_ = type; } 
                                void SetRetCode(const BYTE &rc)         { ret_code_ = rc; }
                                DWORD GetUserID() const                 { return user_id_; }
                                const char *GetGroupName() const        { return group_name_; }
                                BYTE GetGroupID() const                 { return group_id_; }
                                BYTE GetType() const                    { return type_; }
                                BYTE GetOrder() const                   { return order_; }
                                BYTE GetRetCode() const                 { return ret_code_; }

                        private:
                                DWORD user_id_;
                                char group_name_[MAX_NAME_SIZE+1];
                                BYTE group_id_;
                                BYTE order_;
                                BYTE type_;
                                BYTE ret_code_; //0-fail 1-success
                };
                struct stSessionBuddyGroupDelRes:
                        t_NullCmd
                {
                        DWORD user_id_;
                        BYTE group_id_;
                        BYTE ret_code_;         //0-fail 1-success

                        stSessionBuddyGroupDelRes()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_DEL_RES)

                        {
                                user_id_ = 0;
                                group_id_ = 0;
                                ret_code_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetGroupID(const BYTE &groupid)    { group_id_ = groupid; }
                        void SetRetCode(const BYTE &rc)         { ret_code_ = rc; }
                        DWORD GetUserID() const                 { return user_id_; }
                        BYTE  GetGroupID() const                { return group_id_; }
                        BYTE  GetRetCode() const                { return ret_code_; }
                };
                struct stSessionBuddyGroupRenameRes:
                        t_NullCmd
                {
                        DWORD user_id_;
                        BYTE  group_id_;
                        char  group_name_[MAX_NAME_SIZE+1];
                        BYTE  ret_code_;

                        stSessionBuddyGroupRenameRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_RENAME_RES)
                        {
                                user_id_ = 0;
                                group_id_ = 0;
                                bzero(group_name_, sizeof(group_name_));
                                ret_code_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetGroupID(const BYTE &groupid)    { group_id_ = groupid; }
                        void SetGroupName(const char *name)     { strncpy(group_name_, name, MAX_NAME_SIZE); }
                        void SetRetCode(const BYTE &rc)         { ret_code_ = rc; }
                        DWORD GetUserID()       const           { return user_id_; }
                        BYTE  GetGroupID()      const           { return group_id_; }
                        const char *GetGroupName() const        { return group_name_; }
                        BYTE  GetRetCode()      const           { return ret_code_; }
                };
                struct stSessionBuddyGroupUpdateOrderRes:
                        t_NullCmd
                {
                        DWORD user_id_;
                        WORD  num_;
                        struct {
                                BYTE groupid;
                                BYTE grouporder;

                                void SetGroupID(const BYTE &gid) { groupid = gid; }
                                void SetGroupOrder(const BYTE &order) { grouporder = order; }
                                BYTE GetGroupID()       const { return groupid; }
                                BYTE GetGroupOrder()    const { return grouporder; }
                        } list_[0];

                        stSessionBuddyGroupUpdateOrderRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_GROUP_UPDATE_ORDER_RES)
                        {
                                user_id_ = 0;
                                num_ = 0;
                        }
                        void SetUserID(const DWORD &userid)     { user_id_ = userid; }
                        void SetNum(const WORD &num)            { num_ = num; }
                        void IncNum()                           { num_++; }
                        DWORD GetUserID()       const { return user_id_; }
                        WORD  GetNum()          const { return num_; }
                        DWORD GetSize()         const { return sizeof(*this) + num_*sizeof(list_[0]); }
                };
                struct stMisInfoReq:
                        t_NullCmd
                {
                        stMisInfoReq()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_MIS_INFO_REQ)
                        {
                        }
                };
                struct stSessionLoginUserReq:
                        t_NullCmd
                {
                        public:
                                stSessionLoginUserReq()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_LOGIN_USER_REQ)
                                {
                                        user_id_ = 0;
                                        temp_id_ = 0;
                                }
                                void setUserID(const DWORD &uid)        { user_id_ = uid; }
                                void setTempID(const DWORD &tid)        { temp_id_ = tid; }
                                DWORD getUserID() const                 { return user_id_; }
                                DWORD getTempID() const                 { return temp_id_; }
                        private:
                                DWORD user_id_;
                                DWORD temp_id_;
                };
                struct stSessionLoginUserRes:
                        t_NullCmd
                {
                        public:
                                stSessionLoginUserRes()
                                        :t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_LOGIN_USER_RES)
                                {
                                        user_id_        = 0;
                                        token_          = 0;
                                        ret_code_       = 0;
                                        info_len_       = 0;
                                }
                                void setUserID(const DWORD &uid)        { user_id_ = uid; }
                                void setToken(const DWORD &token)       { token_ = token; }
                                void setInfoLen(const WORD &len)        { info_len_ = len; }
                                void setRetCode(const BYTE &ret)        { ret_code_ = ret; }
                                void setInfoData(const std::string &info) { strncpy(info_, info.c_str(), info.size()); }
                                DWORD getUserID() const                 { return user_id_; }
                                DWORD getToken() const                  { return token_; }
                                BYTE  getRetCode() const                { return ret_code_; }
                                WORD  getInfoLen() const                { return info_len_; }
                                const char *getInfoStr() const          { return info_; }
                                DWORD getSize() {
                                        return sizeof(*this)+info_len_*sizeof(info_[0]);
                                }
                        private:
                                DWORD user_id_;
                                DWORD token_;
                                BYTE  ret_code_;        //0-fail 1-success 2-account not exists 3-account forbidden
                                WORD  info_len_;
                                char  info_[0];         //json格式
                                /* info_data_内容如下:
                                 * {
                                 *      "userinfo":{
                                 *              "account":"a",
                                 *              "nickname":"b",
                                 *              "mood":"c",
                                 *              "type":"0",
                                 *              "onlinetime":"123"
                                 *              "status":"0"
                                 *              "option":"0"
                                 *      }
                                 * }
                                 * */
                };
                struct stSessionBuddyListReq:
                        t_NullCmd
                {
                        stSessionBuddyListReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_LIST_REQ)
                        {
                        }
                        DWORD user_id_;
                };
                struct stSessionBuddyListRes:
                        t_NullCmd
                {
                        public:
                                stSessionBuddyListRes()
                                        : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_BUDDY_LIST_RES)
                                {
                                        user_id_        = 0;
                                        finish_         = 0;
                                        list_len_       = 0;
                                }
                                void setUserID(const DWORD &uid)        { user_id_ = uid; }
                                void setFinish(const BYTE &finish)      { finish_ = finish; }
                                void setListLen(const WORD &len)        { list_len_ = len; }
                                void setListStr(const std::string &str) { strncpy(list_, str.c_str(), str.size());}
                                DWORD getUserID() const                 { return user_id_; }
                                BYTE getFinish() const                  { return finish_; }
                                WORD getListLen() const                 { return list_len_; }
                                const char *getListStr() const          { return list_; }
                                DWORD getSize() {
                                        return sizeof(*this)+list_len_*sizeof(list_[0]);
                                }
                        private:
                                DWORD user_id_;
                                BYTE finish_;                   //0-no 1-yes
                                WORD list_len_;
                                char list_[0];                  //json格式字符串
                                /* list_内容如下:
                                 * {
                                 *      "buddyinfo":[
                                 *              {
                                 *                      "userid":"123uint",
                                 *                      "account":"abc",
                                 *                      "buddygroup":"1uint",
                                 *                      "remark":"haha",
                                 *                      "nk":"heihei"
                                 *              },
                                 *              ...
                                 *      ]
                                 * }
                                 * */

                };
                struct stSessionSyncClientReportParameter:
                        t_NullCmd
                {
                        stSessionSyncClientReportParameter()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_SYNC_CLIENT_REPORT_PARAMETER)
                        {
                                size_ = 0;
                        }

                        DWORD getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        WORD size_;
                        char json_[0];
                        // json = si(uint) + sp(uint) + nlt(uint) + lrt(uint)
                };
                struct stSessionFilterWordsReq:
                        t_NullCmd
                {
                        stSessionFilterWordsReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_FILTER_WORDS_REQ)
                        {
                        }
                };
                struct stSessionFilterWordsRes:
                        t_NullCmd
                {
                        stSessionFilterWordsRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_FILTER_WORDS_RES)
                        {
                                finish_ = 0;
                                len_ = 0;
                        }
                        DWORD getSize() 
                        {
                                return sizeof(*this)+len_*sizeof(list_[0]);
                        }
                        void setListStr(const std::string &str) 
                        {
                                strncpy(list_, str.c_str(), str.size());
                        }
                        BYTE finish_;   //0-no, 1-yes
                        WORD len_;
                        char list_[0];  //Json格式
                        /*
                         * {
                         *      "maskwords":
                         *      [
                         *              "word1",
                         *              "word2",
                         *              ...
                         *      ]
                         * }
                         * */
                };
                struct stHistoryRoomListReq:
                        t_NullCmd
                {
                        stHistoryRoomListReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_ROOM_REQ)
                        {
                                user_id_ = 0;
                        }
                        
                        uint32_t user_id_;
                };
                struct stHistoryRoomListRes:
                        t_NullCmd
                {
                        stHistoryRoomListRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_HISTORY_ROOM_RES)
                        {
                                user_id_ = 0;
                                clear_ = 0;
                                size_ = 0;
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(list_[0]);
                        }

                        uint32_t user_id_;
                        uint8_t clear_;
                        uint16_t size_;
                        struct stUT {
                                uint32_t room_id_;
                                uint32_t leave_time_;
                        } list_[0];
                };
                struct stSessionTaskListReq:
                        t_NullCmd
                {
                        stSessionTaskListReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_TASK_LIST_REQ)
                        {
                        }
                };
                struct stSessionTaskListRes:
                        t_NullCmd
                {
                        stSessionTaskListRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_TASK_LIST_RES)
                        {
                                clear_flag = 0;
                                task_len = 0;
                        }
                        uint8_t  clear_flag; //0-not clear 1-clear
                        uint32_t task_len;
                        char task_info[0];
                        uint32_t get_size()
                        {
                                return sizeof(*this)+task_len*sizeof(task_info[0]);
                        }
                };
                struct stSessionUserTaskListReq:
                        t_NullCmd
                {
                        stSessionUserTaskListReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_TASK_LIST_REQ)
                        {
                                user_id = 0;
                        }
                        uint32_t user_id;
                };
                struct stSessionUserTaskListRes:
                        t_NullCmd
                {
                        stSessionUserTaskListRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_TASK_LIST_RES)
                        {
                                user_id = 0;
                                task_len = 0;
                        }
                        uint32_t user_id;
                        uint32_t task_len;
                        char task_info[0]; //json
                        uint32_t get_size()
                        {
                                return sizeof(*this)+task_len*sizeof(task_info[0]);
                        }
                };
                struct stSessionUserTaskStatChange:
                        t_NullCmd
                {
                        stSessionUserTaskStatChange():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_TASK_STAT_CHANGE)
                        {
                                user_id = 0;
                                task_len = 0;
                        }
                        uint32_t user_id;
                        uint32_t task_len;
                        char task_info[0]; //json
                        uint32_t get_size()
                        {
                                return sizeof(*this)+task_len*sizeof(task_info[0]);
                        }
                        //task_info
                        //{
                        //      "id": 1,
                        //      "st": 2,
                        //      "progress": 123
                        //}
                };
                struct stSessionTaskClearOld:
                        t_NullCmd
                {
                        stSessionTaskClearOld():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_TASK_CLEAR_OLD)
                        {
                        }
                };
                struct stSessionUserTaskLastReward:
                        t_NullCmd
                {
                        stSessionUserTaskLastReward():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_TASK_LAST_REWARD)
                        {
                                user_id = 0;
                                task_reward_type = eUserTaskRewardType_flower;
                                reward = 0;
                        }
                        uint32_t user_id;
                        uint8_t  task_reward_type;
                        uint32_t reward;
                };
                struct stSessionUserTaskLastRewardRes:
                        t_NullCmd
                {
                        stSessionUserTaskLastRewardRes():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_TASK_LAST_REWARD_RES)
                        {
                                user_id = 0;
                                task_reward_type = eUserTaskRewardType_flower;
                                reward = 0;
                        }
                        uint32_t user_id;
                        uint8_t  task_reward_type;
                        uint32_t reward;
                };
                struct stSessionPassUserUserstatusChange:
                        t_NullCmd
                {
                        stSessionPassUserUserstatusChange():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_PASS_USER_USERSTATUS_CHANGE)
                        {
                                user_id_ = 0;
                                user_status_ = eUserStatusType_normal;
                        }
                        uint32_t user_id_;
                        uint8_t user_status_;   // 参见eUserStatusType
                };
                struct stSessionPassUserNicknameChange:
                        t_NullCmd
                {
                        stSessionPassUserNicknameChange():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_PASS_USER_NICKNAME_CHANGE)
                        {
                                user_id_ = 0;
                                bzero(nick_name_, sizeof(nick_name_));
                        }

                        uint32_t user_id_;
                        char nick_name_[MAX_NAME_SIZE+1];
                };
                struct stSessionUserNicknameChangeReq:
                        t_NullCmd
                {
                        stSessionUserNicknameChangeReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_NICKNAME_CHANGE_REQ)
                        {
                                user_id_ = 0;
                                bzero(nick_name_, sizeof(nick_name_));
                        }

                        uint32_t user_id_;
                        char nick_name_[MAX_NAME_SIZE+1];
                };
                struct stSessionUserNicknameChangeRet:
                        t_NullCmd
                {
                        stSessionUserNicknameChangeRet():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_NICKNAME_CHANGE_RET)
                        {
                                user_id_ = 0;
                                bzero(nick_name_, sizeof(nick_name_));
                                ret_code_ = 0;
                        }

                        uint32_t user_id_;
                        char nick_name_[MAX_NAME_SIZE+1];
                        uint8_t ret_code_;      // 0成功 非0失败
                };
                struct stSessionArsConfigurationReq:
                        t_NullCmd
                {
                        stSessionArsConfigurationReq():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_ARS_CONFIGURATION_REQ)
                        {
                        }
                };
                struct stSessionArsConfigurationRet:
                        t_NullCmd
                {
                        stSessionArsConfigurationRet():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_ARS_CONFIGURATION_RET)
                        {
                        }

                        uint32_t getSize() const
                        {
                                return sizeof(*this) + size_*sizeof(json_[0]);
                        }

                        uint16_t size_;
                        char json_[0];
                        // json = switch(bool) + timeout(uint) + threshold(uint) + pack_num(uint) + pack_it(uint) + ng_delay(uint) + ng_plr(uint) + bad_delay(uint) + bad_plr(uint)
                };
                struct stSessionUpdateUserOption:
                        t_NullCmd
                {
                        stSessionUpdateUserOption():
                                t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_UPDATE_USER_OPTION)
                        {
                                user_id_ = 0;
                                user_option_ = 0;
                        }

                        uint32_t user_id_;
                        uint8_t user_option_;           // 见eUserOptionType
                };
        }; //namespace Record
}; //namespace Cmd
#pragma pack() //pack(1)

#endif //RECORD_COMMAND_H_
